# coding=utf-8
# 全世界最帅的帅哥
import json
from ysgg1_club_comment.utils.base_serializers import BaseListSerializer


class PermissionListSerializer(BaseListSerializer):

    def to_dict(self):
        permission_info_list = []
        for permission in self.data_list:
            permission_info_list.append({
                "name": permission.name,
                "type": permission.type,
                "menu_url": permission.menu_url,
                "permission_key": permission.permission_key
            })

        return json.dumps(permission_info_list)
